home *** CD-ROM | disk | FTP | other *** search
- import com.siemens.mp.game.GraphicObjectManager;
- import java.util.Random;
-
- // $FF: renamed from: l
- public class class_0 {
- public int positionX;
- public int positionY;
- // $FF: renamed from: a j
- private j field_0;
- public d crystal;
- public d arrow;
- // $FF: renamed from: b int
- private int field_1;
- // $FF: renamed from: c boolean
- private boolean field_2;
- // $FF: renamed from: d k
- private k field_3;
- // $FF: renamed from: e i
- private i field_4;
- // $FF: renamed from: f int
- private int field_5 = 0;
- // $FF: renamed from: g int
- private int field_6 = 10;
- // $FF: renamed from: h int
- private int field_7 = 500;
- // $FF: renamed from: i int
- private int field_8;
- // $FF: renamed from: j java.util.Random
- private Random field_9;
- // $FF: renamed from: k boolean
- private boolean field_10;
-
- public class_0(f var1, GraphicObjectManager var2, i var3, Random var4, k var5, boolean var6) {
- this.field_10 = var6;
- this.field_9 = var4;
- this.field_4 = var3;
- this.field_3 = var5;
- this.field_1 = 100;
- this.field_2 = false;
-
- try {
- this.crystal = var1.getSprite("res\\game_crystal.spr");
- var2.addObject(this.crystal.getSprite());
- this.arrow = var1.getSprite("res\\game_downarrow.spr");
- var2.addObject(this.arrow.getSprite());
- } catch (Exception var8) {
- System.out.println("Exception: " + var8);
- }
-
- }
-
- public boolean collected() {
- return this.field_1 == 0;
- }
-
- public int getPositionX() {
- return this.positionX;
- }
-
- public int getPositionY() {
- return this.positionY;
- }
-
- public void runFrame() {
- if (this.field_2) {
- if (this.field_1 == 100 && this.field_10) {
- this.field_4.ad.play();
- }
-
- this.field_1 -= 4;
- this.crystal.setFrame((100 - this.field_1) / 25);
- if (this.crystal.getFrame() >= 4) {
- this.field_1 = 0;
- this.crystal.setVisible(false);
- this.arrow.setVisible(false);
- } else {
- this.field_3.setScore(this.field_3.getScore() + this.field_8);
- this.field_4.b(this.field_3.getScore());
- }
- } else {
- --this.field_7;
- }
-
- }
-
- public void setLevel(j var1) {
- this.field_0 = var1;
- }
-
- public void setPosition(int var1, int var2) {
- this.positionX = var1;
- this.positionY = var2 - 12;
- this.crystal.setVisible(true);
- this.arrow.setVisible(true);
- }
-
- public void startCollecting() {
- this.field_2 = true;
- this.field_8 = (this.field_7 << 2) / 100;
- if (this.field_8 < 2) {
- this.field_8 = 2;
- }
-
- if (this.field_8 > 30) {
- this.field_8 = 30;
- }
-
- }
-
- public void stopCollecting() {
- this.field_2 = false;
- }
-
- public void updatePosition() {
- if (this.field_5 == 0) {
- --this.field_6;
- } else {
- ++this.field_6;
- }
-
- if (this.field_6 > 20 || this.field_6 < 0) {
- this.field_5 ^= 1;
- }
-
- this.crystal.setPosition(this.positionX - this.field_0.levelX, this.positionY - this.field_0.levelY);
- this.arrow.setPosition(this.positionX - this.field_0.levelX + 4, this.positionY - this.field_0.levelY - 15 - (this.field_6 >> 1));
- }
- }
-